package com.itheima.controller;

import com.itheima.pojo.ClazzOption;
import com.itheima.pojo.JobOption;
import com.itheima.pojo.Result;
import com.itheima.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

/**
 * 数据统计
 */
@RequestMapping("/report")
@RestController
public class ReportController {
    @Autowired
    private EmpService empService;

    /**
     * 员工性别数据统计
     *
     * @return
     */
    @GetMapping("/empGenderData")
    public Result empGenderData() {
        List<Map<String, Object>> jobOption = empService.empGenderData();
        return Result.success(jobOption);
    }

    /**
     * 员工职位数据统计
     *
     * @return
     */
    @GetMapping("/empJobData")
    public Result jobData() {
        JobOption jobOption = empService.jobData();
        return Result.success(jobOption);
    }

    /**
     * 学生学历数据统计
     *
     * @return
     */
    @GetMapping("/studentDegreeData")
    public Result studentDegreeData() {
        List<Map<String, Object>> jobOption = empService.studentDegreeData();
        return Result.success(jobOption);
    }

    /**
     * 学生班级数据统计
     *
     * @return
     */
    @GetMapping("/studentCountData")
    public Result studentCountData() {
        ClazzOption clazzOption = empService.studentCountData();
        return Result.success(clazzOption);
    }
}
